<template>
  <div class="more-item" @click="$router.push('/feeds/' + id)">
    <div class="item-pic">
      <img :src="img_url" alt="" />
      <div class="collection" @click.stop="addLikes">
        <div class="col-icon">
          <img src="@/assets/head/Cb.png" alt="" />
        </div>
        <div class="col-count">{{ like_count }}</div>
      </div>
    </div>
    <div class="item-info">
      <div class="title">{{ title }}</div>
      <div class="detail">
        <div class="address-info">
          <div class="address">
            <span class="icon">
              <img src="@/assets/head/3g.png" alt="" />
            </span>
            <span class="text">{{ address }}</span>
          </div>
          <div class="time">
            <span class="icon">
              <img src="@/assets/head/Gl.png" alt="" />
            </span>
            <span class="text">{{ time }}</span>
          </div>
        </div>
        <div class="price-info">
          <span class="desc">{{ desc }}</span>
          <span class="price">{{ price }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    img_url: String,
    title: String,
    address: String,
    time: String,
    desc: String,
    price: String,
    id: Number,
    like_count: Number
  },
  methods: {
    addLikes() {
      console.log(this.id)
    }
  }
}
</script>

<style lang="less" scoped>
.more-item {
  border: 1px solid #aaa;
  margin-bottom: 20px;
  box-shadow: 0 2px 5px #b2b2b2;
  img {
    height: 100%;
    width: 100%;
  }
  .item-pic {
    width: 100%;
    height: 300px;
    position: relative;

    .collection {
      position: absolute;
      right: 10px;
      top: 10px;
      padding: 5px;
      text-align: center;

      .col-icon {
        margin: 0 auto 2px;
        width: 20px;
        height: 20px;
      }

      .col-count {
        font-size: 12px;
        color: #fff;
        font-weight: 600;
      }
    }
  }
  .item-info {
    padding: 0 10px 10px;
    .title {
      font-size: 18px;
      font-weight: 700;
      color: #000;
      padding: 5px 0;
      overflow: hidden;
      line-height: 24px;
      text-overflow: ellipsis;
      -webkit-line-clamp: 2;
      display: -webkit-box;
      -webkit-box-orient: vertical;
    }
    .detail {
      color: #b2b2b2;
      font-size: 14px;
      line-height: 20px;

      .address-info {
        display: flex;
        align-items: center;

        div {
          display: flex;
          line-height: 24px;
          &.time {
            margin-left: 10px;
          }
          .icon {
            margin-top: 2px;
            margin-right: 2px;
            height: 14px;
            width: 14px;
          }
        }
      }
    }

    .price-info {
      display: flex;
      justify-content: space-between;
      align-items: center;

      .price {
        font-size: 16px;
        font-weight: 600;
        color: #d94648;
      }
    }
  }
}
</style>
